package cc.dong.util;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author xiaoDong
 * @version 1.0.0
 * @ClassName EmployeeIDGenerator.java
 * @Description TODO
 * @createTime 2024年05月30日 08:18:00
 */
public class EmployeeIDGenerator {
    private static int count = 0;

    public static synchronized String generateEmployeeID(){
        count++;
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
        String timestamp = dateFormat.format(new Date());
        return "C"+timestamp+String.format("%03d", count);
    }

    public static void main(String[] args) {
        System.out.println(generateEmployeeID());
        System.out.println(generateEmployeeID());
        System.out.println(generateEmployeeID());
    }
}
